package rabbitclient.receiver;


import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author zhanghaixuan
 * @date 2020-02-22 13:06
 */
@Slf4j
@Component
public class Receiver {

    // queues是指要监听的队列的名字
    @RabbitListener(queues = "q_topic_message")
    public void receiveTopic1(String user) {
        log.info("【client2监听到消息】" + user);
    }

    @RabbitListener(queues = "q_topic_messages")
    public void receiveTopic2(String user) {
        log.info("【client2监听到消息】" + user);
    }
}
